﻿using System;
using System.Windows.Input;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;

namespace PhotoMap
{
    public partial class About : PhoneApplicationPage
    {
        public About()
        {
            InitializeComponent();

            versionTextBlock.Text = SystemConfig.Version;
        }

        #region private field

        #endregion

        #region callback

        private void evaluateButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var task = Common.SafelyCreateTask<MarketplaceDetailTask>();

            if (task == null) return;
            task.ContentIdentifier = "192a65a2-9980-472c-92a6-5ba91fa0243f";
            task.ContentType = MarketplaceContentType.Applications;
            task.Show();
        }

        private void feekbackButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var task = Common.SafelyCreateTask<EmailComposeTask>();

            if (task == null) return;
            task.To = @"derekxu416@hotmail.com";
            task.Subject = "照片地图意见反馈";
            task.Show();
        }

        private void cet4TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            var task = Common.SafelyCreateTask<MarketplaceDetailTask>();

            if (task == null) return;
            task.ContentIdentifier = "d61781f4-89e3-43e6-a8f2-7ac5eef35449";
            task.ContentType = MarketplaceContentType.Applications;
            task.Show();

        }

        private void cet6TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            var task = Common.SafelyCreateTask<MarketplaceDetailTask>();

            if (task == null) return;
            task.ContentIdentifier = "64541398-588e-4200-a493-b9630d10ab7e";
            task.ContentType = MarketplaceContentType.Applications;
            task.Show();

        }

        private void greTextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            var task = Common.SafelyCreateTask<MarketplaceDetailTask>();

            if (task == null) return;
            task.ContentIdentifier = "154ac839-ba5a-4bc5-9d61-6c72096753c1";
            task.ContentType = MarketplaceContentType.Applications;
            task.Show();

        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            Common.ResetSafelyTaskFlag();
            base.OnNavigatedTo(e);
        }
        #endregion

        #region private method

        
        #endregion


    }
}